<template>
  <a-content :page="false">
    1 - 1
    <DialogCom
      v-model:open="open"
      title="标题"
      :before-change="aaa"
      :inner-loading="innerLoading"
    />
    <DialogCom
      v-model:open="open1"
      title="标题1212"
      :before-change="aaa"
      :inner-loading="innerLoading"
    />
    <button type="button" @click="test">测试</button>
    <button type="button" @click="api">api</button>
    <button type="button" @click="toggleLang('zh')">中文</button>
    <button type="button" @click="toggleLang('en')">英文</button>
    <br />
    {{ $t("home.test") }}<br />
    <Section title="2323">
      <col-label-group>
        <col-label label="推荐信成绩要求与注意事项">
          adsf
          <download-file label="text" :file-list="fileList" />
        </col-label>
      </col-label-group>
    </Section>
  </a-content>
</template>
<script setup>
import { ref } from "vue";
import { useLangI18n } from "@/language";
import DialogCom from "./test.vue";
import Section from "@/components/section";
import colLabelGroup from "@/components/colLabelGroup";
import colLabel from "@/components/colLabel";
import DownloadFile from "@/components/downloadFile";
// import { demo } from "@/api"
const fileList = ref([]);
setTimeout(() => {
  fileList.value = [
    { text: "推荐信成绩要求与注意事项.png", id: 11111 },
    { text: "推荐信成事项.png", id: 2222 },
  ];
}, 2000);

const { useSetLang } = useLangI18n();
const toggleLang = (lang) => {
  useSetLang(lang);
};

const open = ref(false);
const open1 = ref(false);
const afterClose = () => {
  open.value = false;
};
const test = () => {
  open.value = true;
};
const api = () => {
  // demo({username: '12321323'}).then(() => {
  //   console.log(11)
  // }).catch(() => {
  //   console.log(22)
  // })
};

const innerLoading = () => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      open1.value = true;
      resolve();
    }, 2000);
  });
};

const aaa = () => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve();
    }, 2000);
  });
};
</script>
